package com.ibeifeng.io;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class TestDataInputStream {
	public static void main(String[] args) {
		DataInputStream dis = null;
		DataOutputStream dos = null;
		try {
			dos = new DataOutputStream(new FileOutputStream("D:\\Workspaces\\temp\\1.wzm"));
			dos.writeLong(123456);
			dos.writeInt(999);
			dis = new DataInputStream(new FileInputStream("D:\\Workspaces\\temp\\1.wzm"));
			long num = dis.readLong();
			System.out.println(num);
			num = dis.readInt();
			System.out.println(num);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		
	}
}
